package cn.wondertek.cms.controller;

import cn.wondertek.system.domain.CmsSysRoleMenu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.wondertek.common.core.domain.R;
import cn.wondertek.common.core.controller.BaseController;
import cn.wondertek.cms.service.ICmsSysRoleMenuService;

/**
 * 【请填写功能名称】 提供者
 *
 * @author ruoyi
 * @date 2020-06-02
 */
@RestController
@RequestMapping("menu")
public class CmsSysRoleMenuController extends BaseController
{

	@Autowired
	private ICmsSysRoleMenuService cmsSysRoleMenuService;

	/**
	 * 查询${tableComment}
	 */
	@GetMapping("get/{menuId}")
	public CmsSysRoleMenu get(@PathVariable("menuId") Long menuId)
	{
		return cmsSysRoleMenuService.selectCmsSysRoleMenuById(menuId);

	}

	/**
	 * 查询【请填写功能名称】列表
	 */
	@GetMapping("list")
	public R list(CmsSysRoleMenu cmsSysRoleMenu)
	{
		startPage();
        return result(cmsSysRoleMenuService.selectCmsSysRoleMenuList(cmsSysRoleMenu));
	}


	/**
	 * 新增保存【请填写功能名称】
	 */
	@PostMapping("save")
	public R addSave(@RequestBody CmsSysRoleMenu cmsSysRoleMenu)
	{
		return toAjax(cmsSysRoleMenuService.insertCmsSysRoleMenu(cmsSysRoleMenu));
	}

	/**
	 * 修改保存【请填写功能名称】
	 */
	@PostMapping("update")
	public R editSave(@RequestBody CmsSysRoleMenu cmsSysRoleMenu)
	{
		return toAjax(cmsSysRoleMenuService.updateCmsSysRoleMenu(cmsSysRoleMenu));
	}

	/**
	 * 删除${tableComment}
	 */
	@PostMapping("remove")
	public R remove(String ids)
	{
		return toAjax(cmsSysRoleMenuService.deleteCmsSysRoleMenuByIds(ids));
	}


}
